package com.fuhao.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {


    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016092500594714";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCen6nnonug+75hLQMzrcWmNSiTVMsjm1/2S42S24AfPFy/X5f/ImA/Pdwibzsz1dHd2xzPk2mAu78lPE1YE71PLyJ7HWFuQ/d1Lgl1AlYQBon9IHQ0lgRbFge9gRGv+TkJxA0p6lzaWYUln9UwZFBI8UB1AdsN3fo5tBOUj/mn8k8hZPvEN0QVGo+Z3giJgFoGzQ0/E5jr1ZAxWa+aJ86SS4eL4wqvuEtVQR1D08FiOQ1rG1zst0VIDRcz6R/bOu/L3JaUntWeUBhi+6icDKMC/35GIwDMUO1ATFkJOOuJYjNWmjArQhnnEC2O2PSGv5OQl9Mo4pZqEVC4yMsKkx0FAgMBAAECggEANpOu7ODt8ozLiznmkSBoEfDWXiLdpgmusdp7Ap19bsHhE4N7k7ArN3c8R6jH0OTvyYq7VfxdX4q5kME3x2c7SoRoM73/KOY/vVSysky0ed0WGz7QXMuFAiYJUb2X7Vkts9t9v/9AJWyJsFFXE8hgC0jeqaOS0CmhD7uSxRnoh0z/aBfE5rdHxYQQigqA3UNlsGkzdHW0Ldf19ol2AlZq2exol26i8Hyq8TprKjTaz/bAJ1AJVcsKz5tds0jwpbPUgFAbNSIokGtvFpLIal8I1FUU+fVArFlsxBXukCnKV8itrwFQIG1l27gDau374uSfjpf/kxozUd9ukmmGHgg+XQKBgQDe0eO/RPnnSEPbgSwaYVoRjRUdtp4GGhzSplTPrKVsre3mRBR42nMInzRoyK+ubPXrc+cpvmep//4Pt1JIc/ZrxnzTo6eEBNu2RzbwcNkBrRB4ii3nSqgsZu3pi6Ks668FoagRm8QLjPC86f+d00kNTPA501QpodIJkq6CjNWV8wKBgQC2Po1/aAsY1OyGAHp+kgCgJVru2CfpT9o77lHDQ3sryndrFTQp9m0JbMAOWyXVZHtRTqGxWWzyhbcS2uRK76V9vbq6Q8s3L4fZE7h4Nxsd39/RMRti5arIwaIR06lnHgAitZTi+KZYRTwSJEs2Pnmv1jGPMd1qKKj+FRVWrRnnJwKBgBKY9idavHj/YRqLF4FEKt5YJjEKsvnTaCB03ZNP16bQhZC4kfTcVsmbcCZmybMHSSdTzzF+wOxBf5UUOfvuId0w/e40NKEiPqxiGUXMRXCMX1mQPvCVHKBIHwdlLji8mykfKwX9OEm2g8lgxoMHxYskptBMwTOQXBWMdqBS3OjdAoGAGIsQD0p5xBxYxismVAlhoC+nsWbW6Srh3xRXWo6p9dnMf1VZsxUG1jAZJVXNIJHpsad/Sx0Z+QddAmMMP7NKfEai8RbUNVhnWSq4uyfgtQNDZy7P21/GwkahhvkUZVi69/GwXWjTLiwUzPSqVGHRjYaxIfG7OeLD74PzXbruNB0CgYAl4OwEmFbOhaWls11cD/6LPDDgwohY3go/A0qHZXZFY8dP9sB8JjrdpAujkuz6YtwQDVdmDhHExSuU5JqTVJIJDVcdmoXJitCJ45bfGH09TnPY4oA2VgiB3SQwuXwmbuuwf8t7jeKmJcZwn9Mmh2wptv1PHqwPQUQXoeijwnpvLg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApVcZMGznIoGIg2TSeWvw2konG28iJgmsIHhJjNsv9GvFwO55dgyFeXg780MkCmCdK7t7i+/J7D4YrwMR9eCeuEaPWd3CrnowEN0KldMsbTDOUgPnGyK0HFTAOwyicODHEJ/NnG85KibwyZ6xG0S5Ug13Cvs62fDtiC0iGdDZ7HFyTqVLtXwTefpJOqBtAXoaUT81JCWL6/xhS45CEesgTkf1k4vSTTKblRGhJ8rp5/IvQQC057H0nFR11wJzPROhLZNNS8DbrV3bCUffFkaoDkX0rkOT1gCMgHcQ6taz8+xjdsHdHv70xTmEl/Oile/vZnqbFV/3E2C7N4PljjHZ5QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://zhang.ngrok.xiaomiqiu.cn/aliPayAsynCallback";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://www.baidu.com";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";



    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}